import scrapy


class CarSpider(scrapy.Spider):
    name = "car"
    allowed_domains = ["car.autohome.com.cn"]
    start_urls = ["https://car.autohome.com.cn/motorbike"]

    def parse(self, response):
        print("car  home ================")
        name_list = response.xpath('//span[@class="Car_item__name__Vbqtn"]/text()')
        price_list = response.xpath('//span[@class="Car_item__price__m0Cpd"]/text()')
        for i in range(len(name_list)):
            name = name_list[i].extract()
            price = price_list[i].extract()
            print(name, price)
